﻿using System;
using NUnit.Framework;
using ProjetoComperio.BusinessLogicLayer;
using ProjetoComperio.DataLayer.Entities;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Linq;

namespace ProjetoComperio.Test.BusinessLogicLayer
{
    [TestFixture]
    public class ContributionItemBLLTest
    {
        private ContributionItemBLL _contributionItemBLL;
        private AcademicPersonBLL _academicPersonBLL;

        public AcademicPersonBLL AcademicPersonBLL
        {
            get
            {
                if (_academicPersonBLL == null)
                    _academicPersonBLL = new AcademicPersonBLL();


                return _academicPersonBLL;

            }

        }

        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            _contributionItemBLL = new ContributionItemBLL();
        }

        [Test]
        public void TestValidCreate()
        {
            var contributionItem = new ContributionItem
            {
                FileName = "TEste.pdf",
                FileUrl = "C:/project",
                UploadDate = DateTime.Now,
                ContributionID = 17
            };

            _contributionItemBLL.Create(contributionItem);
            Assert.IsNotNull(_contributionItemBLL.RetrieveContributionItem(contributionItem.ContributionItemID));
        }

    }
}
